//
//  OrderNewsCollectionViewCell.m
//  UniversalApp
//
//  Created by 志刚杨 on 2018/2/9.
//  Copyright © 2018年 voidcat. All rights reserved.
//

#import "OrderNewsCollectionViewCell2.h"

@implementation OrderNewsCollectionViewCell2

- (void)awakeFromNib {
    [super awakeFromNib];
    ViewRadius(self.headerImage, 35/2);
    self.labLocalhost.textColor = MainColor;
    self.headerImage.contentMode = UIViewContentModeScaleAspectFill;
}


-(void)setModel:(OrderModel *)model
{
    _model = model;
    
    if(KIOSBASE)
    {
        self.headerImage.image = [[CYCommon sharedCYCommon] getKatongImageWidthID:model.id];
    }
    else{
        
        [self.headerImage sd_setImageWithURL:[[CYURLUtils sharedCYURLUtils] safeUrl:model.avatar] placeholderImage:[[CYCommon sharedCYCommon] getEpmayImage]];
    }
    
    if([model.is_online isEqualToString:@"1"]){
        UIImage *radImage = [[UIImage imageWithColor:MainColor size:CGSizeMake(3, 3)] imageByRoundCornerRadius:1.5];
        self.dotImage.image = radImage;
    }
    else
    {
        UIImage *radImage = [[UIImage imageWithColor:CLightGray size:CGSizeMake(3, 3)] imageByRoundCornerRadius:1.5];
        self.dotImage.image = radImage;
    }
    
    self.labnickname.text = model.user_nickname;
    
    [self.level getViewType:model.sex AndLevel:model.level];
    self.labLocalhost.text = model.address;
}

@end
